package com.zhongke.DKYCboot.controller;

import com.zhongke.DKYCboot.bean.BaseRole;
import com.zhongke.DKYCboot.mapper.BaseRoleMapper;
import com.zhongke.DKYCboot.service.BaseRoleService;
import com.zhongke.DKYCboot.util.Msg;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@CrossOrigin
@RequestMapping("/BaseRoleController")
@ResponseBody
public class BaseRoleController {
    @Autowired private BaseRoleService baseRoleService;

    @RequestMapping(value = "/getRoleByName" ,method = RequestMethod.POST)
    //模糊查询
    public Msg getRoleByName(@RequestBody BaseRole baseRole) {
        //调用service层的查询方法
        return baseRoleService.selectBaseRoleByRoleName(baseRole);

    }
    //添加
    @RequestMapping(value = "/insert" ,method = RequestMethod.POST)
    public Msg insertBaseRole( @RequestBody  BaseRole baseRole){
        return baseRoleService.insertBaseRole(baseRole);
    }
    //修改
    @RequestMapping(value = "/update" ,method = RequestMethod.POST)
    public Msg updateBaseRole( @RequestBody  BaseRole baseRole){
        return baseRoleService.updateBaseRole(baseRole);
    }
    //删除
    @RequestMapping(value = "/delete" ,method = RequestMethod.POST)
    public Msg deleteBaseRole( @RequestBody  BaseRole baseRole){
        return baseRoleService.deleteBaseRole(baseRole);
    }
}
